
/*This do file generates the estimation samples for Table A8.
 Initial sample includes US-born individuals from ACS 2000 and 2005 and 2000 Census with birth cohorts 1964 to 1976 */
clear all
set matsize 10000
set maxvar 40000
set more off
global data " "
global dir " "
use $data/acs_census_2000_2005_main.dta
 
 
*Keep women
keep if sex==2
*race
	g hisp = (hispan>0)
	g white = (race==1)&!hisp
	g black = ((race==2)|inrange(raced,830,845))&!hisp /* Label as black those with black as one of two races. */
*education--high school or more.
keep if educd>=62

*division
gen division=.
replace division=1 if mom_birth_state==9|mom_birth_state==23|mom_birth_state==25|mom_birth_state==33|mom_birth_state==44|mom_birth_state==50
replace division=2 if mom_birth_state==34|mom_birth_state==36|mom_birth_state==42
replace division=3 if mom_birth_state==18|mom_birth_state==17|mom_birth_state==26|mom_birth_state==39|mom_birth_state==55
replace division=4 if mom_birth_state==19|mom_birth_state==20|mom_birth_state==27|mom_birth_state==29|mom_birth_state==31|mom_birth_state==38|mom_birth_state==46
replace division=5 if mom_birth_state==10|mom_birth_state==11|mom_birth_state==12|mom_birth_state==13|mom_birth_state==24|mom_birth_state==37|mom_birth_state==45 |mom_birth_state==51|mom_birth_state==54
replace division=6 if mom_birth_state==1|mom_birth_state==21|mom_birth_state==28|mom_birth_state==47
replace division=7 if mom_birth_state==5|mom_birth_state==22|mom_birth_state==40|mom_birth_state==48
replace division=8 if mom_birth_state==4|mom_birth_state==8|mom_birth_state==16|mom_birth_state==35|mom_birth_state==30|mom_birth_state==49|mom_birth_state==32|mom_birth_state==56
replace division=9 if mom_birth_state==2|mom_birth_state==6|mom_birth_state==15|mom_birth_state==41|mom_birth_state==53

*age categories
gen age_cat=.
replace age_cat=1 if age<20
replace age_cat=2 if age>=20&age<=24
replace age_cat=3 if age>=25&age<=34
replace age_cat=4 if age>=35

*Family Income
	foreach var of varlist ftotinc  {
		replace `var' = `var'*1.46 if year==2000
		replace `var' = `var'*1.42 if year==2001
		replace `var' = `var'*1.40 if year==2002
		replace `var' = `var'*1.36 if year==2003
		replace `var' = `var'*1.34 if year==2004
		replace `var' = `var'*1.30 if year==2005
 	}	
	


gen FamilyIncome=ftotinc
replace FamilyIncome=0 if FamilyIncome<0
drop if FamilyIncome  <=5000
gen L_FamilyIncome=log(FamilyIncome)

*Any Public Assistance
g any_public_ass=0
replace any_public_ass=1 if  incwelfr>0	
	
*labor force participation
g lfp=0
replace lfp=1 if labforce==2         

*More than high school 
gen edu13=0
replace edu13=1 if educd>=71

*generate black and white estimation samples
preserve
keep if black==1
save acs_census_full_estimation_sample_blacks, replace
restore

preserve
keep if white==1
save acs_census_full_estimation_sample_whites, replace
restore



